package cn.com.cfae.iras.doc.analyze.parse.model;

import cn.com.cfae.iras.doc.analyze.parse.kv.KVText;

import java.util.List;

/**
 * 文档数据模型
 */
public class DocumentModel {

    public int getTotalPageNumber() {
        return totalPageNumber;
    }

    public void setTotalPageNumber(int totalPageNumber) {
        this.totalPageNumber = totalPageNumber;
    }

    public String getDocumentName() {
        return documentName;
    }

    public void setDocumentName(String documentName) {
        this.documentName = documentName;
    }

    public List<ChapterModel> getChapterModels() {
        return chapterModels;
    }

    public void setChapterModels(List<ChapterModel> chapterModels) {
        this.chapterModels = chapterModels;
    }

    private int totalPageNumber;

    private String documentName;

    public TableType getTableType() {
        return tableType;
    }

    public void setTableType(TableType tableType) {
        this.tableType = tableType;
    }

    private TableType tableType;

    private List<ChapterModel> chapterModels;

    public void addChapterModel(ChapterModel chapterModel) {
        boolean isExist = false;
        for (int i = 0; i < chapterModels.size(); i++) {
            ChapterModel var1 = chapterModels.get(i);
            if (chapterModel.getChapterId().equalsIgnoreCase(var1.getChapterId())) {
                isExist = true;
                break;
            }
        }
        if (!isExist) {
            chapterModels.add(chapterModel);
        }
    }

    public void addActualChapterModel(ChapterModel chapterModel) {
        actualChapterModelList.add(chapterModel);
    }

    public ChapterModel getLastChapterModel() {
        return getChapterModels().get(chapterModels.size() - 1);
    }

    public ChapterModel getLastActualChapterModel() {
        return getActualChapterModelList().get(actualChapterModelList.size() - 1);
    }

    public String getPdfFilePath() {
        return pdfFilePath;
    }


    List<KVText> noThousandSeparatorList;

    public List<KVText> getNoThousandSeparatorList() {
        return noThousandSeparatorList;
    }

    public void setNoThousandSeparatorList(List<KVText> noThousandSeparatorList) {
        this.noThousandSeparatorList = noThousandSeparatorList;
    }


    public void setPdfFilePath(String pdfFilePath) {
        this.pdfFilePath = pdfFilePath;
    }

    private String pdfFilePath;

    public ChapterModel getChapterModel(String tableId) {
        for (ChapterModel cm : chapterModels) {
            if (tableId.equals(cm.getChapterId())) {
                return cm;
            }
        }
        return null;
    }

    public IndustryType getIndustryType() {
        return industryType;
    }

    public void setIndustryType(IndustryType industryType) {
        this.industryType = industryType;
    }

    IndustryType industryType;

    public List<ChapterModel> getActualChapterModelList() {
        return actualChapterModelList;
    }

    public void setActualChapterModelList(List<ChapterModel> actualChapterModelList) {
        this.actualChapterModelList = actualChapterModelList;
    }

    List<ChapterModel> actualChapterModelList = null;

}
